import 'dart:io';
import 'package:catguard/entity/user_info.dart';
import 'package:catguard/pages/home/fragment/fragment_home.dart';
import 'package:catguard/pages/home/fragment/fragment_mine.dart';
import 'package:catguard/pages/home/fragment/fragment_record.dart';
import 'package:catguard/utils/user_utils.dart';
import 'package:common_utils/common_utils.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_udid/flutter_udid.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:package_info_plus/package_info_plus.dart';

import '../../config/config.dart';
import '../../routers/routers.dart';
import '../../utils/singleton_manager.dart';

class HomeLogic extends GetxController {

  var currentIndex = 0.obs;
  var pages = <Widget>[].obs;

  var devices=<Map>[].obs; //设备列表
  var familyList=<dynamic>[].obs;//家庭列表
  var currentFamily=(0).obs; //当前选中家庭

  var currentPetRecords=<dynamic>[].obs; //当前宠物手账记录


  @override
  void onInit() async {
    // TODO: implement onInit
    super.onInit();
  }

  @override
  void onReady() async {

    pages.add(FragmentHome());
    pages.add(FragmentRecord());
    pages.add(FragmentMine());

    devices.add({'type':1,'count':2});
    devices.add({'type':2,'count':1});
    devices.add({'type':3,'count':12});

    familyList.add("element");

  }

  periodic() {
    // const period = Duration(seconds: 1);
    // listTimer = Timer.periodic(period, (timer) async {
    // });
  }

  @override
  void onClose() {}
}
